﻿        <!-- 不同身份拓客对比 -->
<div class="page-tab-box">
    <div class="chart-trend">
        <div class="head clearfix">
            <span class="fl">不同身份拓客对比</span>
            <i class="fl report-icon-help" ui-tip url="views/broker-quality/tips-1.html"></i>
            <div class="date">
                <label class="radio"><input type="radio" name="trend-date1" ng-model="query.compareChartCycle" value="2"><span>日</span></label>
                <label class="radio ng-hide" ng-show="baseData.allowWeekCycle"><input type="radio" name="trend-date1" ng-model="query.compareChartCycle" value="1"><span>周</span></label>
                <label class="radio ng-hide" ng-show="baseData.allowMonthCycle"><input type="radio" name="trend-date1" ng-model="query.compareChartCycle" value="0"><span>月</span></label>
            </div>
        </div>

        <div class="report-content" id="tuoke_content">
            <ul class="clearfix">
                <li ng-class="{'on': query.type == '1'}" ng-click="query.type = '1'; query.queryTuokeChart(); query.queryTuokeDetail()">
                    <p class="title">推荐客户</p><span class="tip">(已接收)</span>
                </li>
                <li ng-class="{'on': query.type == '2'}" ng-click="query.type = '2'; query.queryTuokeChart(); query.queryTuokeDetail()">
                    <p class="title">到访客户</p><span class="tip">(已接收)</span>
                </li>
                <li ng-class="{'on': query.type == '3'}" ng-click="query.type = '3'; query.queryTuokeChart(); query.queryTuokeDetail()">
                    <p class="title">认筹客户</p><span class="tip">&nbsp;</span>
                </li>
                <li ng-class="{'on': query.type == '4'}" ng-click="query.type = '4'; query.queryTuokeChart(); query.queryTuokeDetail()">
                    <p class="title">认购客户</p><span class="tip">&nbsp;</span>
                </li>
                <li ng-class="{'on': query.type == '5'}" ng-click="query.type = '5'; query.queryTuokeChart(); query.queryTuokeDetail()">
                    <p class="title">签约客户</p><span class="tip">&nbsp;</span>
                </li>
                <li ng-class="{'on': query.type == '6'}" ng-click="query.type = '6'; query.queryTuokeChart(); query.queryTuokeDetail()">
                    <p class="title">认购金额</p><span class="tip">&nbsp;</span>
                </li>
                <li ng-class="{'on': query.type == '7'}" ng-click="query.type = '7'; query.queryTuokeChart(); query.queryTuokeDetail()">
                    <p class="title">签约金额</p><span class="tip">&nbsp;</span>
                </li>
            </ul>

            <div id="graphic_03" class="graphic" ng-show="query.tuokeChartData.length"></div>
            <div class="no-data ng-hide" ng-show="query.tuokeChartData && !query.tuokeChartData.length"><span>暂无数据</span></div>
        </div>
    </div>

    <div class="toggle-table" ng-class="{'unfold': showDetail }" ng-click="showDetail = !showDetail">
        <span class="ico" ng-show="!showDetail">展开</span>
        <span class="ico ng-hide" ng-show="showDetail">收起</span>
    </div>

    <div class="detail-data ng-hide" ng-show="showDetail">
        <div class="head clearfix">
            <span>详细数据</span>
            <div class="date">
                <label class="radio"><input type="radio" name="trend-date2" ng-model="query.compareDetailCycle" value="2"><span>日</span></label>
                <label class="radio ng-hide" ng-show="baseData.allowWeekCycle"><input type="radio" name="trend-date2" ng-model="query.compareDetailCycle" value="1"><span>周</span></label>
                <label class="radio ng-hide" ng-show="baseData.allowMonthCycle"><input type="radio" name="trend-date2" ng-model="query.compareDetailCycle" value="0"><span>月</span></label>
                <a href="javascript:;" class="down" ng-click="query.exportTuokeDetail()">导出</a>
            </div>
        </div>

        <div class="detail-data">
            <div class="report-content-auto mt10" id="table_content_03" ng-show="query.tuokeDetailData.detail.length"></div>
            <div class="no-data ng-hide" ng-show="query.tuokeDetailData.detail && !query.tuokeDetailData.detail.length"><span>暂无数据</span></div>

            <div ui-pagination page-index="query.tuokeDetailPageIndex" page-size="query.tuokeDetailPageSize" 
                 total="query.tuokeDetailTotal" changed="query.queryTuokeDetail($pageIndex)"></div>
        </div>
    </div>

    <div class="detail-data">
        <div class="head clearfix">
            <span>全部项目不同身份经纪人拓客数量</span>
            <div class="date">
                <a href="javascript:;" class="down" ng-click="query.exportTuokeAllProjectDetail()">导出</a>
            </div>
        </div>

        <div class="report-content-auto mt10" id="table_content_04" ng-show="query.tuokeAllProjectDetailData.length">
        </div>
        <div class="no-data ng-hide" ng-show="query.tuokeAllProjectDetailData && !query.tuokeAllProjectDetailData.length"><span>暂无数据</span></div>
    </div>

    <div class="detail-data">
        <div class="chart-trend">
            <div class="head clearfix">
                <span class="fl">不同身份转化率</span>
                <i class="fl report-icon-help" ui-tip url="views/broker-quality/tips-2.html"></i>
            </div>
            <div class="ng-hide" ng-show="!!query.tuokeIdentityData.detail.length" 
                 style="border:1px solid #E4E9ED; margin-top:10px">
                <div class="report-content" style=" margin-top:0; overflow:visible">
                    <ul class="clearfix js-tab-identity">
                        <li ng-repeat="record in query.tuokeIdentityData.detail"
                            ng-class="{ 'on': tuokeIdentityChartIndex == $index}"
                            ng-click="showTuokeIdentityChart($index)">
                            <p class="title" ng-bind="record.identityName"></p>
                        </li>
                    </ul>
                </div>
                <div class="report-content" id="tuoke_content_05">
                    <div style=" float: left; width: 30%; height: 100%;">
                        <div style="height: 100%; background-color: white">
                            <div style="padding:0 20px 20px; text-align: center">
                                <div id="p_tj" class="cststatus" style="width: 86%;"></div>
                                <div id="p_dk" class="cststatus" style="width: 76%;"></div>
                                <div id="p_rg" class="cststatus" style="width: 66%;"></div>
                                <div id="p_qy" class="cststatus" style="width: 56%;"></div>
                            </div>
                        </div>
                    </div>
                    <div style=" float: left; width:20%; height: 180px; margin-top:15px">
                        <b style=" display:block; text-align:center">推荐转到访</b>
                        <div id="pie_rate_dk" style="height: 160px;"></div>
                    </div>
                    <div style=" float: left; width:20%; height: 180px; margin-top:15px">
                        <b style=" display:block; text-align:center">到访转认购（含直签）</b>
                        <div id="pie_rate_rg" style="height: 160px;"></div>
                    </div>
                    <div style=" float: left; width:20%; height: 180px; margin-top:15px">
                        <b style=" display:block; text-align:center">推荐转签约</b>
                        <div id="pie_rate_cj" style="height: 160px;"></div>
                    </div>
                </div>
                <div id="graphic_05" class="graphic"></div>
            </div>
            <div class="no-data ng-hide" ng-show="query.tuokeIdentityData.detail && !query.tuokeIdentityData.detail.length"><span>暂无数据</span></div>
        </div>
    </div>

    <div class="toggle-table" ng-class="{'unfold': showDetail2 }" ng-click="showDetail2 = !showDetail2">
        <span class="ico" ng-show="!showDetail2">展开</span>
        <span class="ico ng-hide" ng-show="showDetail2">收起</span>
    </div>

    <div class="detail-data ng-hide" ng-show="showDetail2">
        <div class="head clearfix">
            <span>客户明细表</span>
            <div class="date">
                <a href="javascript:;" class="down" ng-click="query.exportTuokeIdentity()">导出</a>
            </div>
        </div>

        <div class="report-content-auto mt10" id="table_content_05" ng-show="query.tuokeIdentityData.detail.length"></div>
        <div class="no-data ng-hide" ng-show="query.tuokeIdentityData.detail && !query.tuokeIdentityData.detail.length"><span>暂无数据</span></div>
    </div>

</div>

<!-- 不同身份拓客对比 -->

<!-- 不同身份拓客对比 模板 -->
<script type="text/template" id="templ_tab">
    <ul class="clearfix js-tab">
        <li class="on"><p class="title">推荐客户</p><span class="tip">(已接收)</span></li>
        <li><p class="title">到访客户</p><span class="tip">(已接收)</span></li>
        <li><p class="title">认筹客户</p><span class="tip">&nbsp;</span></li>
        <li><p class="title">认购客户</p><span class="tip">&nbsp;</span></li>
        <li><p class="title">签约客户</p><span class="tip">&nbsp;</span></li>
        <li><p class="title">成交金额</p><span class="tip">&nbsp;</span></li>
    </ul>
</script>

<script type="text/template" id="templ_table_03_1">
    <table>
        <tr class="bg-blur">
            <th rowspan="2" class="date" style="min-width: 150px;">日期</th>
            <# for(var j = 0; j < xLen; j++) { #>
                <#=(j % 2 === 0) ? '<th colspan="3" class="bg-th">' : '<th colspan="3">'#><#=identityName[j]#></th>
            <# } #>
        </tr>

        <tr class="bg-blur">
            <# for(j = 0; j < xLen; j++) { #>
                <td style="min-width:70px">已接收</td><td style="min-width:70px">已拒收</td><td style="min-width:70px">未审核</td>
            <# } #>
        </tr>

        <# for(var i = 0; i < yLen; i++) { #>
            <#=(i > 0 && i != yLen - 1 && i % 2 == 1) ? '<tr class="bg-blur">' : '<tr>'#>
                <# for(j = 0; j < xLen; j++) { #>
                    <#if(j === 0){#><td class="date"><#=data[j][i].xdate#></td><#}#>
                    <td><#=this.thousands(data[j][i].tjjiesCount)#></td>
                    <td><#=this.thousands(data[j][i].tjjusCount)#></td>
                    <td><#=this.thousands(data[j][i].tjwshCount)#></td>
                <# } #>
            </tr>

            <#if(i == yLen - 1) {#>
                <tr class="total">
                    <td class="b">总计</td>
                    <# for(j = 0; j < xLen; j++) { #>
                        <td><#=this.thousands(totalJiesCount[j])#></td>
                        <td><#=this.thousands(totalJusCount[j])#></td>
                        <td><#=this.thousands(totalWshCount[j])#></td>
                    <# } #>
                </tr>
            <#}#>
        <#}#>
    </table>
</script>
    
<script type="text/template" id="templ_table_03_2">
    <table>
        <tr class="bg-blur">
            <th rowspan="2" class="date" style="min-width: 150px;">日期</th>
            <# for(var j = 0; j < xLen; j++) { #>
                <#=(j % 2 === 0) ? '<th colspan="2" class="bg-th">' : '<th colspan="2">'#><#=identityName[j]#></th>
            <# } #>
        </tr>

        <tr class="bg-blur">
            <# for(j = 0; j < xLen; j++) { #>
                <td>已接收</td><td>已拒收</td>
            <# } #>
        </tr>

        <# for(var i = 0; i < yLen; i++) { #>
            <#=(i > 0 && i != yLen - 1 && i % 2 == 1) ? '<tr class="bg-blur">' : '<tr>'#>
                <# for(j = 0; j < xLen; j++) { #>
                    <#if(j === 0){#><td class="date"><#=data[j][i].xdate#></td><#}#>
                    <td><#=this.thousands(data[j][i].dkjiesCount)#></td>
                    <td><#=this.thousands(data[j][i].dkjusCount)#></td>
                <# } #>
            </tr>

            <#if(i == yLen - 1) {#>
                <tr class="total">
                    <td class="b">总计</td>
                    <# for(j = 0; j < xLen; j++) { #>
                        <td><#=this.thousands(totalJiesCount[j])#></td>
                        <td><#=this.thousands(totalJusCount[j])#></td>
                    <# } #>
                </tr>
            <#}#>
        <#}#>
    </table>
</script>
    
<script type="text/template" id="templ_table_03_3">
<table>
    <tr class="bg-blur">
        <th class="date" style="min-width: 150px;">日期</th>
        <# for(var j = 0; j < xLen; j++) { #>
            <#=(j % 2 === 0) ? '<th class="bg-th">' : '<th>'#><#=identityName[j]#></th>
        <# } #>
    </tr>

    <# for(var i = 0; i < yLen; i++) { #>
        <#=(i > 0 && i != yLen - 1 && i % 2 == 1) ? '<tr class="bg-blur">' : '<tr>'#>
            <# for(j = 0; j < xLen; j++) { #>
                <#if(j === 0){#><td class="date"><#=data[j][i].xdate#></td><#}#>
                <td><#=this.thousands(data[j][i].rcCount)#></td>
            <# } #>
        </tr>

        <#if(i == yLen - 1) {#>
            <tr class="total">
                <td class="b">总计</td>
                <# for(j = 0; j < xLen; j++) { #>
                    <td><#=this.thousands(totalRcCount[j])#></td>
                <# } #>
            </tr>
        <#}#>
    <#}#>
</table>
</script>
    
<script type="text/template" id="templ_table_03_4">
<table>
    <tr class="bg-blur">
        <th class="date" style="min-width: 150px;">日期</th>
        <# for(var j = 0; j < xLen; j++) { #>
            <#=(j % 2 === 0) ? '<th class="bg-th">' : '<th>'#><#=identityName[j]#></th>
        <# } #>
    </tr>

    <# for(var i = 0; i < yLen; i++) { #>
        <#=(i > 0 && i != yLen - 1 && i % 2 == 1) ? '<tr class="bg-blur">' : '<tr>'#>
            <# for(j = 0; j < xLen; j++) { #>
                <#if(j === 0){#><td class="date"><#=data[j][i].xdate#></td><#}#>
                <td><#=this.thousands(data[j][i].rgCount)#></td>
            <# } #>
        </tr>

        <#if(i == yLen - 1) {#>
            <tr class="total">
                <td class="b">总计</td>
                <# for(j = 0; j < xLen; j++) { #>
                    <td><#=this.thousands(totalRgCount[j])#></td>
                <# } #>
            </tr>
        <#}#>
    <#}#>
</table>
</script>
    
<script type="text/template" id="templ_table_03_5">
    <table>
        <tr class="bg-blur">
            <th class="date" style="min-width: 150px;">日期</th>
            <# for(var j = 0; j < xLen; j++) { #>
                <#=(j % 2 === 0) ? '<th class="bg-th">' : '<th>'#><#=identityName[j]#></th>
            <# } #>
        </tr>

        <# for(var i = 0; i < yLen; i++) { #>
            <#=(i > 0 && i != yLen - 1 && i % 2 == 1) ? '<tr class="bg-blur">' : '<tr>'#>
                <# for(j = 0; j < xLen; j++) { #>
                    <#if(j === 0){#><td class="date"><#=data[j][i].xdate#></td><#}#>
                    <td><#=this.thousands(data[j][i].qyCount)#></td>
                <# } #>
            </tr>

            <#if(i == yLen - 1) {#>
                <tr class="total">
                    <td class="b">总计</td>
                    <# for(j = 0; j < xLen; j++) { #>
                        <td><#=this.thousands(totalQyCount[j])#></td>
                    <# } #>
                </tr>
            <#}#>
        <#}#>
    </table>
</script>
    
    <script type="text/template" id="templ_table_03_6">
    <table>
        <tr class="bg-blur">
            <th class="date" style="min-width: 150px;">日期</th>
            <# for(var j = 0; j < xLen; j++) { #>
                <#=(j % 2 === 0) ? '<th class="bg-th">' : '<th>'#><#=identityName[j]#></th>
            <# } #>
        </tr>

        <# for(var i = 0; i < yLen; i++) { #>
            <#=(i > 0 && i != yLen - 1 && i % 2 == 1) ? '<tr class="bg-blur">' : '<tr>'#>
                <# for(j = 0; j < xLen; j++) { #>
                    <#if(j === 0){#><td class="date"><#=data[j][i].xdate#></td><#}#>
                    <td><#=this.thousands1(data[j][i].cjAmount)#></td>
                <# } #>
            </tr>

            <#if(i == yLen - 1) {#>
                <tr class="total">
                    <td class="b">总计</td>
                    <# for(j = 0; j < xLen; j++) { #>
                        <td><#=this.thousands1(totalCjAmount[j])#></td>
                    <# } #>
                </tr>
            <#}#>
        <#}#>
    </table>
</script>
    
    <script type="text/template" id="templ_table_03_7">
    <table>
        <tr class="bg-blur">
            <th class="date" style="min-width: 150px;">日期</th>
            <# for(var j = 0; j < xLen; j++) { #>
                <#=(j % 2 === 0) ? '<th class="bg-th">' : '<th>'#><#=identityName[j]#></th>
            <# } #>
        </tr>

        <# for(var i = 0; i < yLen; i++) { #>
            <#=(i > 0 && i != yLen - 1 && i % 2 == 1) ? '<tr class="bg-blur">' : '<tr>'#>
                <# for(j = 0; j < xLen; j++) { #>
                    <#if(j === 0){#><td class="date"><#=data[j][i].xdate#></td><#}#>
                    <td><#=this.thousands1(data[j][i].cjAmount)#></td>
                <# } #>
            </tr>

            <#if(i == yLen - 1) {#>
                <tr class="total">
                    <td class="b">总计</td>
                    <# for(j = 0; j < xLen; j++) { #>
                        <td><#=this.thousands1(totalCjAmount[j])#></td>
                    <# } #>
                </tr>
            <#}#>
        <#}#>
    </table>
</script>

<script type="text/template" id="templ_table_04">
    <table>
        <tr class="bg-blur">
            <th rowspan="2" class="date" style="min-width:150px;">项目</th>
            <# for(var j = 0; j < xLen; j++) { #>
                <#=(j % 2 === 0) ? '<th colspan="7" class="bg-th">' : '<th colspan="7">'#><#=identityName[j]#></th>
            <# } #>
        </tr>

        <tr class="bg-blur">
            <# for(j = 0; j < xLen; j++) { #>
                <td style="min-width:80px;"><p>推荐客户</p><span>(已接收)</span></td><td style="min-width:80px;"><p>到访客户</p><span>(已接收)</span></td><td style="min-width:80px;">认筹客户</td><td style="min-width:80px;">认购客户</td><td style="min-width:80px;">签约客户</td><td style="min-width:80px;">认购金额</td><td style="min-width:80px;">签约金额</td>
            <# } #>
        </tr>

        <# for(var i = 0; i < yLen; i++) { #>
            <#=(i > 0 && i != yLen - 1 && i % 2 == 1) ? '<tr class="bg-blur">' : '<tr>'#>
                <# for(j = 0; j < xLen; j++) { #>
                    <#if(j === 0){#><td class="date"><#=data[j][i].projName#></td><#}#>
                    <td><#=this.thousands(data[j][i].tjCount)#></td>
                    <td><#=this.thousands(data[j][i].dkCount)#></td>
                    <td><#=this.thousands(data[j][i].rcCount)#></td>
                    <td><#=this.thousands(data[j][i].rgCount)#></td>
                    <td><#=this.thousands(data[j][i].qyCount)#></td>
                    <td><#=this.thousands1(data[j][i].cjrgCount)#></td>
                    <td><#=this.thousands1(data[j][i].cjqyCount)#></td>
                <# } #>
            </tr>

            <#if(i == yLen - 1) {#>
                <tr class="total">
                    <td class="b">总计</td>
                    <# for(j = 0; j < xLen; j++) { #>
                        <td><#=this.thousands(totalTjCount[j])#></td>
                        <td><#=this.thousands(totalDkCount[j])#></td>
                        <td><#=this.thousands(totalRcCount[j])#></td>
                        <td><#=this.thousands(totalRgCount[j])#></td>
                        <td><#=this.thousands(totalQyCount[j])#></td>
                        <td><#=this.thousands1(totalCjrgCount[j])#></td>
                        <td><#=this.thousands1(totalCjqyCount[j])#></td>
                    <# } #>
                </tr>
            <#}#>
        <#}#>
    </table>
</script>

<script type="text/template" id="templ_table_05">
    <table>
        <tr class="bg-blur"><th>身份类型</th><th>成功推荐人数</th><th>当前已到访</th><th>当前已认购（含直签）</th><th>当前已签约</th><th>推荐转到访</th><th>到访转认购（含直签）</th><th>推荐转签约</th></tr>
        <# for(var i = 0, len = detail.length; i < len; i++) { #>
            <#var record = detail[i];#>
            <#=(i > 0 && i != len - 1 && i % 2 == 1) ? '<tr class="bg-blur">' : '<tr>'#>
                <td><#=record.identityName#></td>
                <td><#=this.thousands(record.tjjiesCount)#></td>
                <td><#=this.thousands(record.curDkCount)#></td>
                <td><#=this.thousands(record.curRgCount)#></td>
                <td><#=this.thousands(record.curQyCount)#></td>
                <td><#=record.dk2tjRate#>%</td>
                <td><#=record.cj2dkRate#>%</td><td>
                <#=record.cj2tjRate#>%</td>
            </tr>
        <# } #>
        <tr class="total">
            <td class="b">总计</td>
            <td><#=this.thousands(totalTjjiesCount)#></td>
            <td><#=this.thousands(totalCurDkCount)#></td>
            <td><#=this.thousands(totalCurRgCount)#></td>
            <td><#=this.thousands(totalCurQyCount)#></td>
            <td><#=totalDk2tjRate#>%</td>
            <td><#=totalCj2dkRate#>%</td>
            <td><#=totalCj2tjRate#>%</td>
        </tr>
    </table>
</script>


